home *** CD-ROM | disk | FTP | other *** search
- global gAudioList, gCurr, gAudioPath, gAudioPlayFlag
-
- on PlayAudio aPrp, aChan
- global gLastSnd1, gLastSnd2, gLastSnd3
- if voidp(aChan) then
- set aChan to 1
- end if
- set str to getaProp(gAudioList, aPrp)
- set aSnd to item 1 of str
- set vol to item 2 of str
- if aChan = 1 then
- if soundBusy(aChan) then
- if gLastSnd1 = aSnd then
- nothing()
- else
- sound stop aChan
- set the volume of sound aChan to value(vol)
- puppetSound(aChan, aSnd)
- set gLastSnd1 to aSnd
- end if
- else
- set the volume of sound aChan to value(vol)
- puppetSound(aChan, aSnd)
- set gLastSnd1 to aSnd
- end if
- else
- if aChan = 2 then
- if soundBusy(aChan) then
- if gLastSnd2 = aSnd then
- nothing()
- else
- sound stop aChan
- set the volume of sound aChan to value(vol)
- puppetSound(aChan, aSnd)
- set gLastSnd2 to aSnd
- end if
- else
- set the volume of sound aChan to value(vol)
- puppetSound(aChan, aSnd)
- set gLastSnd2 to aSnd
- end if
- else
- if aChan = 3 then
- if soundBusy(aChan) then
- if gLastSnd3 = aSnd then
- nothing()
- else
- sound stop aChan
- set the volume of sound aChan to value(vol)
- sound playFile aChan, gAudioPath & aSnd
- set gLastSnd3 to aSnd
- end if
- else
- set the volume of sound aChan to value(vol)
- sound playFile aChan, gAudioPath & aSnd
- set gLastSnd3 to aSnd
- end if
- end if
- end if
- end if
- end
-